<#macro templateTree filepath type>
	<@_templateList path=filepath type=type>
		<@_metadata dir=filepath type=type><#local metaDataMap=object/></@_metadata>
		<#list list as a>
			<li>
				<#local path=filepath+'/'+a.fileName>
				<a href="${type}Template/${a.directory?then('directory','content')}.html?path=${path?url}&type=${type}" target="ajax" rel="${type}TemplateBox">
					${a.fileName} ${(metaDataMap[a.fileName].alias)?has_content?then('('+metaDataMap[a.fileName].alias+')','')}
				</a>
			<#if a.directory>
				<ul>
					<@templateTree path type/>
				</ul>
			</#if>
			</li>
		<#else>
			<li><a>空目录</a></li>
		</#list>
	</@_templateList>
</#macro>